]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
environment: Add convenience method for adjustment transitions
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 25 Jul 2019 14:21:46 +0000 (16:21 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 7 Aug 2019 16:40:49 +0000 (18:40 +0200)
By now, Tweener is used exclusively to animate changes to the
StAdjustment:value property. But not for long, as now that we
implement the same transition API as Clutter.Actor, we can
re-use the existing convenience method for property transitions
for adjustment changes as well.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/669

js/ui/environment.js

index f2944a5c1bc13dd596e9925899f63c75c8d61c2f..60d73d9ccb83e905dd8c3320560e1bff71059ac1 100644 (file)
@@ -220,6 +220,11 @@ function init() {
     Clutter.Actor.prototype.ease_property = function(propName, target, params) {
         _easeActorProperty(this, propName, target, params);
     };
+    St.Adjustment.prototype.ease = function(target, params) {
+        // we're not an actor of course, but we implement the same
+        // transition API as Clutter.Actor, so this works anyway
+        _easeActorProperty(this, 'value', target, params);
+    };
 
     Clutter.Actor.prototype.toString = function() {
         return St.describe_actor(this);